using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
    public static class BO_cms {
        public static DataTable Trash_Select_All(string keywords, int start_index, int max_record) {
            try {
                usp_Trash_Select_All entity = new usp_Trash_Select_All();
                entity.KEYWORDS = keywords;
                entity.MAXRECORDS = max_record;
                entity.STARTINDEX = start_index;
                return BO_Actions<usp_Trash_Select_All>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Trash_Select(string keywords, string item_category, int start_index, int max_record) {
            try {
                usp_Trash_Select entity = new usp_Trash_Select();
                entity.KEYWORDS = keywords;
                entity.ITEM_CATEGORY = item_category;
                entity.MAXRECORDS = max_record;
                entity.STARTINDEX = start_index;
                return BO_Actions<usp_Trash_Select>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Trash_Delete(string item_category, int item_id) {
            try {
                usp_Trash_Delete entity = new usp_Trash_Delete();
                entity.ITEM_CATEGORY = item_category;
                entity.ITEM_ID = item_id;
                return BO_Actions<usp_Trash_Delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Trash_Restore(string item_category, int item_id) {
            try {
                usp_Trash_Restore entity = new usp_Trash_Restore();
                entity.ITEM_CATEGORY = item_category;
                entity.ITEM_ID = item_id;
                return BO_Actions<usp_Trash_Restore>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Join_Tables_Insert(int id1, int id2, string foreign_key, int var1, int var2) {
            try {
                usp_portal_join_tables_insert entity = new usp_portal_join_tables_insert();
                entity.ID_1 = id1;
                entity.ID_2 = id2;
                entity.FOREIGN_KEY = foreign_key;
                entity.VAR1 = var1;
                entity.VAR2 = var2;
                return BO_Actions<usp_portal_join_tables_insert>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Join_Tables_Delete(int id1, int id2, string foreign_key) {
            try {
                usp_portal_join_tables_delete entity = new usp_portal_join_tables_delete();
                entity.ID_1 = id1;
                entity.ID_2 = id2;
                entity.FOREIGN_KEY = foreign_key;
                return BO_Actions<usp_portal_join_tables_delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Join_Tables_Select(int id, string foreign_key, bool type) {
            try {
                usp_portal_join_tables_select entity = new usp_portal_join_tables_select();
                entity.ID = id;
                entity.FOREIGN_KEY = foreign_key;
                entity.TYPE = type;
                return BO_Actions<usp_portal_join_tables_select>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Join_Tables_Order(string STRING, string foreign_key, int ID_2) {
            try {
                usp_portal_join_tables_order entity = new usp_portal_join_tables_order();
                entity.ID_2 = ID_2;
                entity.FOREIGN_KEY = foreign_key;
                entity.STRING = STRING;
                return BO_Actions<usp_portal_join_tables_order>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Join_Tables_Update(int id1, int id2, string foreign_key, int var1, int var2) {
            try {
                usp_portal_join_tables_update entity = new usp_portal_join_tables_update();
                entity.ID_1 = id1;
                entity.ID_2 = id2;
                entity.FOREIGN_KEY = foreign_key;
                entity.VAR1 = var1;
                entity.VAR2 = var2;
                return BO_Actions<usp_portal_join_tables_update>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }
}

